/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Common;

/**
 *
 * @author Mario,Thomas,Max,Martin,Sergio
 */
public enum MessageType
{

    ServerSync((short) 1),
    ClientSync((short) 2),
    ElectionMaster((short) 4);
    private final short _type;

    MessageType(short type)
    {
        this._type = type;
    }

    public short type()
    {
        return _type;
    }

    public static MessageType Parse(short type)
    {
        switch(type)
                {
            case 1:
                return ServerSync;
            case 2:
                return ClientSync;
            case 4:
                return ElectionMaster;
            default:
                return null;
        }
    }
}



